package com.demo;

public class Demo {
    public static int[] sort(int[] a){
        int temp;
        for (int i = 1; i < a.length ; i++) {
            for (int j = 0; j < a.length-i; j++) {
                if (a[j]>a[j+1]){
                    temp =a[j];
                    a[j]=a[j+1];
                    a[j+1]=temp;
                }
            }
        }
        return a;
    }

    public static void main(String[] args) {
        int[]a={3,1,4,6,13,15,5};
        int[]array=Demo.sort(a);
        for (int i = 0; i < array.length; i++) {
            System.out.println(array[i]);
        }
    }
}
